<?php
header("Content-type:text/html;charset=utf-8");
$get_url = $_GET['url'];
$url='https://qsy.psntw.com/api/index.php?url='.$get_url;
$agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$curl = curl_init();
//设置抓取的url
curl_setopt($curl, CURLOPT_URL,$url);
//设置头文件的信息作为数据流输出
curl_setopt($curl, CURLOPT_HEADER, 0);
//设置获取的信息以文件流的形式返回，而不是直接输出。
//curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

//重要！
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书和hosts
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl,CURLOPT_USERAGENT,$agent); //模拟浏览器代理

//执行命令
$data = curl_exec($curl);
//关闭URL请求
curl_close($curl);